unit udlgSelectGroup;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, uBaseDialog, StdCtrls, ComCtrls, ExtCtrls, ImgList;

type
  TdlgSelectGroup = class(TBaseDialog)
    lv1: TListView;
    btn1: TButton;
    btn2: TButton;
    il1: TImageList;
    procedure btn1Click(Sender: TObject);
  private
    function GetSelectTitle: string;
    { Private declarations }
  public
    procedure AddGroup(const ATitle:string);
    property SelectTitle: string read GetSelectTitle;
    { Public declarations }
    
  end;


var
  dlgSelectGroup:TdlgSelectGroup;


implementation

{$R *.dfm}

procedure TdlgSelectGroup.AddGroup(const ATitle:string);
begin
  lv1.AddItem(ATitle, nil);
end;

procedure TdlgSelectGroup.btn1Click(Sender: TObject);
begin
  if Assigned(lv1.Selected) then
    ModalResult := mrOk;
end;

function TdlgSelectGroup.GetSelectTitle: string;
begin
  if Assigned(lv1.Selected) then
    Result := lv1.Selected.Caption
  else
    Result := '';
end;

end.
